package packet;

import shared.Consts.Priorities;
import server.Game;
import server.Lobby;

/**
 *
 * @author Joel Garboden
 */
public class PlayerQuitReq extends Request
{
  public final String playerName;

  /**
   *
   * @param playerName
   */
  public PlayerQuitReq(String playerName)
  {
    this.playerName = playerName;
    this.priority = Priorities.TURN_UPDATE;
  }

  @Override
  public boolean processRequest(Game game)
  {
    game.playerQuitCmd(playerName);
    return true;
  }

  @Override
  public boolean lobbyRequest(Lobby lobby)
  {
    lobby.playerQuitCmd(playerName);
    return true;
  }

  @Override
  public String toString()
  {
    return "playerQuitRequest from: " + playerName;
  }
}
